package capillary;

import java.util.Scanner;

public class Solution1 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int t = s.nextInt();
		while (t-- > 0) {
			String line = s.next();
			String[] splitByFire = line.split("\\*");
			int nEnemy = 0;
			for (String str : splitByFire) {
				if(!str.contains("X")) {
					nEnemy = nEnemy + str.length();
				}
			}
			System.out.println(nEnemy);
		}

		s.close();
	}

}
